/***************************************************************************
 *   Copyright (C) 2009 by Zheng Yonglei
 *   zhengyonglei@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef OPTIONS_H_
#define OPTIONS_H_

#include <QSettings>
#include <QVariant>
#include <QTimer>
#include <QFont>
#include <QDir>
#include <QSplashScreen>
#include <QPixmap>
#include <QRect>
#include <QDate>

#include "StaticModule.h"
#include "types.h"

#define OPT INSTANCE(Options)

class Options
{
public:
	Options();
	~Options();

	void readSettings();
	void writeSettings();

	QRect scaleGeometry(const QRect& parent, float widthRate, float heightRate);
	void setCursorBusy(bool busy);

	QDate getCurrendDate();

public:
	//global
	QSplashScreen splash;
	bool isPaused;
	QString language;
	bool useSystemDate;
	QDate currentDate;

	//account
	QString lastAccount;
	bool hasLogined;

	//dictionary
	bool autoSpeak;

	//Test analysis dialog
	int quickSelectWordCount;
	int selectWordPolicy;
	int scanRangePolicy;

	//Test manager
	int testWordCountMin;
	int firstGroupWaitSecMax;
	int secondGroupWaitSecMin;

	//main window geometry
	Qt::WindowStates mainWindowStatus;
	QRect mainWinGeo;

	//font size
	QFont programFont;
	QFont wordBrowserFont;

	//ANN
	bool autoStartTrainer;
	int trainEpochMS;
	int checkFinishedEpochCount; //The number of last epochs that used to determine the end of training
	float finishedMSEOfMSEs; //The maximum mean square error of MSEs every epoch return
	int trainEpochCountMax;
};

#endif /* OPTIONS_H_ */
